home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: memory allocation using malloc and free
- Date: 25 Feb 1996 13:11:30 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4gqja2INN8vr@keats.ugrad.cs.ubc.ca>
- References: <4gagll$5rc@bertrand.ccs.carleton.ca> <4gbqd7$1em@inet-nntp-gw-1.us.oracle.com> <4gd8ngINNp5i@keats.ugrad.cs.ubc.ca> <danpop.824952492@rscernix>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <danpop.824952492@rscernix>, Dan Pop <danpop@mail.cern.ch> wrote:
- >In <4gd8ngINNp5i@keats.ugrad.cs.ubc.ca> c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) writes:
- >
- >>But can a compiler which restricts size_t to 16-bits a be a strictly conforming
- >>implementation? (I don't have the standard documents yet, so I'm forced to
- >>ask).
- >
- >Yes.
-
- How did that get out? I cancelled that article within literally minutes of
- having sent it.
-
- Say, wasn't NNTP designed by a bunch of zoologists? ;)
-
- >>If 16-bit size_t is admitted within the limitations of the standard, it
- >>means that a strictly conforming program has to robustly accomodate itself on
- >>such crippled architectures. I know that ANSI has some bottom limits on what
- >>can be considered a viable architecture to host the C language, but what are
- >>those limits?
- >
- >For this particular discussion, the limit is 32K - 1. And no more than
- >one object of this size. (Actually the phrasing is a little bit silly,
- >because it doesn't even guarantee that every program containing such an
- >object can be compiled and run, it requires that at least one program
- >should be correctly translated):
- >
- > 2.2.4.1 Translation limits
- >
- > The implementation shall be able to translate and execute at least
- > one program that contains at least one instance of every one of the
- > following limits:
- >...
- > * 32767 bytes in an object (in a hosted environment only)
-
- That is strange wording. I wonder what the "at least one program" refers to.
- At least one arbitrary string of input symbols that represents a valid C
- program sentence, such that the slightest change results in a different program
- that doesn't have to be translated? Or translate any such program and then
- erase itself out at its own discretion? :) Or execute one such program in the
- sense of multi-programming, where two or more can be loaded at the same time?
- Hmm.
-
- The answer to my cancelled article is enlightening, however. I cancelled
- because I did find a somewhat satisfactory answer in the K&R, which does
- clearly state that the minimum maximum for an integer is 32768. Limits are not
- given for size_t, but I inferred that this would also be an acceptable minimum
- maximum for that type.
-
- By the way, it would have been good to show the other "following limits". To
- what extent can you directly reproduce portions of the standard in the
- newsgroup? What is a reasonable quote and what is not? I mean, if I were to
- keep quoting K&R in responses to questions, _eventually_ someone will be able
- to collect the entire work, which would mark me as a plagiarist. :)
- --
-
-